<template>
	<view style=" background-image: linear-gradient(#f4f4f4 , #ffffff);">
		<view class="px-3 main-bg-color position-relative" style="height: 300upx;">
			<view class="row main-text-color-bai a-center j-sb" style="height: 130upx;padding-top:60upx;">
				<view class="row a-center" style="height: 126upx;">
					<image :src="baseUrl+items.store_bgimg" style="width: 126upx;height: 126upx;border-radius:15upx;overflow: hidden;"></image>
					<view class="pl-2">
						<view class="store">
							{{items.store_name}}
						</view>
						<view class="">
							{{items.address}}
						</view>
					</view>
				</view>
				<view @tap="mdqrcode()" class="row a-center px-2">
					<image src="../../static/my_qrcode.png" style="width: 35upx;height: 35upx;"></image>
				</view>
				<!-- <view @tap="mqrcode()" v-if="items.agent_type>1" class="row a-center px-2">
					
					<image src="../../static/my_qrcode.png" style="width: 35upx;height: 35upx;"></image>
				</view>
				
				<view @tap="qrcode()" class="row a-center px-2">
					
					<image src="../../static/my_qrcode.png" style="width: 35upx;height: 35upx;"></image>
				</view> -->
			</view>
		</view>
		<view class="cash" style="background-color:#FFFFFF;width:700upx;height:270upx;position:fixed;top:330upx;margin-left:25upx;border-radius:10upx;">
			<view class="row" style="width:700upx;">
				<block v-for="(item,index) in distributionTab" :key="index">
					<view class="d-flex flex-column a-center right_bottom_border"
					@tap="event(item)" style="width:231upx;padding-top:50upx;padding-bottom:50upx;border:1upx solid #e6e6e6;">
						<image :src="item.src" 
						style="width: 65upx;height: 65upx;"
						mode="aspectFit" class="mb-2"></image>
						<text class=" font-sm">{{item.text}}</text>
					</view>
				</block>
			</view>
		</view>
	</view>
</template>

<script>
	import request from '@/common/lib/request.js'
	export default {
		data() {
			return {
				baseUrl:request.common.baseUrl,
				distributionTab:[{
					path:'/pages/agent/set',
					src:'../../static/store_manage.png',
					text:'门店信息管理'
				},
				{
					path:'/pages/agent/storemember',
					src:'../../static/store_member.png',
					text:'门店会员'
				},
				{
					path:'/pages/agent/verification',
					src:'../../static/store_verification.png',
					text:'核销订单'
				},
				{
					path:'/pages/agent/storestaff',
					src:'../../static/store_staff.png',
					text:'员工管理'
				}],
				items:''
			}
		},
		onLoad:function(option){
			uni.request({
			    url: request.common.baseUrl+'/api/agent/myStore',
			    data: {
					token:uni.getStorageSync('keyToken'),
					id:option.id
				},
			    header: {
					'Content-Type':'application/json;charset=UTF-8',
					'Content-Type':'application/x-www-form-urlencoded'
			    },
			    success: (res) => {
					if(res.data.code==200){
						this.items=res.data.data
					}
			    }
			});
			
		},
		methods: {
			event(item){
				uni.navigateTo({
					url:item.path+'?id='+this.items.id+'&work_time='+this.items.work_time+'&store_manage='+this.items.store_manage+'&tel_phone='+this.items.tel_phone+'&store_name='+this.items.store_name+'&store_bgimg='+this.items.store_bgimg+'&address='+this.items.address
				})
			},
			qrcode(){
				uni.navigateTo({
					url:"/pages/agent/qrcode?agent_code_id="+this.items.id
				})
			},
			mqrcode(){
				uni.navigateTo({
					url:"/pages/agent/mqrcode?magent_code_id="+this.items.id
				})
			},
			mdqrcode(){
				uni.navigateTo({
					url:"/pages/agent/mdqrcode?store_id="+this.items.id
				})
			}
		}
	}
</script>

<style>
.right_bottom_border:nth-child(1){
	border-right-style:unset !important;
	border-top-left-radius:10upx;
}
.right_bottom_border:nth-child(2){
	border-right-style:unset !important;
}
.right_bottom_border:nth-child(4){
	border-top-style:unset !important;
	border-top-right-radius:10upx;
}
.store{
	font-size:34upx;
}
.cash_score{
	width:233upx;
	float:left;
	text-align:center;
	padding-top:25upx;
	padding-bottom:25upx;
}
.cash_score view{
	font-size:32upx;
	color:#111111;
}
.cash_score text{
	color:#999999;
	font-size:24upx;
}
.cash_withdraw{
	margin:12upx 50upx;
}
.cash_withdraw_l{
	float:left;
}
.cash_withdraw_l text:nth-child(1){
	font-size:24upx;
	color:#666666;
}
.cash_withdraw_l text:nth-child(2){
	font-size:32upx;
	color:#111111;
	margin-left:10upx;
}
.cash_withdraw_r{
	float:right;
}
.cash_withdraw_button{
	background-color:#2ed50b;
	color:#FFFFFF;
	font-size:24upx;
	border-radius:30upx;
	padding:10upx 30upx;
}
</style>
